﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using BicycleTrafficSimulator.DataModel;

namespace BicycleTrafficSimulator.Presentation
{
    class FeedbackScreen : GameScreen
    {
        private Texture2D image;
        private Rectangle imageRectangle;
        private SpriteFont spriteFont;
        private Score score;
       // private BicycleTrafficSimulator.Game game;
       // private Texture2D texture2D;
       // private Score Score;

        public FeedbackScreen(Scene game, SpriteBatch spriteBatch, SpriteFont spriteFont, Texture2D image, Score score)
            : base(game, spriteBatch)
        {
            this.image = image;
            imageRectangle = new Rectangle((Game.Window.ClientBounds.Width - this.image.Width) / 2,
                                           (Game.Window.ClientBounds.Height - this.image.Height) / 2,
                                           this.image.Width,
                                           this.image.Height);
            this.spriteFont = spriteFont;
            this.score = score;
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            spriteBatch.Begin();
            spriteBatch.Draw(image, imageRectangle, Color.White);
            DrawText();
            spriteBatch.End();
            base.Draw(gameTime);
           
        }

        public void DrawText()
        {
            spriteBatch.DrawString(spriteFont, "Score: " + score.Value, new Vector2(this.imageRectangle.X + this.imageRectangle.Width/2 - 100, this.imageRectangle.Y + this.imageRectangle.Height - 100), Color.Black);
        }
    }
}
